home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 23
/
AACD 23.iso
/
AACD
/
Magazine
/
YAM
/
Rexx
/
GotoURL.yam
< prev
next >
Wrap
Text File
|
2000-04-19
|
2KB
|
91 lines
/* GotoURL.yam - Passes URL's from YAM to a web browser */
/* $VER: GotoURL.yam 1.3 (25.02.00) © 2000 by M.Beck <mbeck@yam.ch> */
/* based on Harry Samwels <samwel@algonet.se> script */
/* Tested with IBrowse 1.2, Voyager 2.95 and AWeb 3.1 */
/* */
/* Call this script from */
/* YAM/Configuration/ARexx/When double-clicking an URL */
/* Use Miami to go online if necessary (1=yes) */
UseMiami=1
/* Path and filename of Miami */
MiamiPath = "MIAMI:Miami"
/* Path and filename of your default browser */
BrowserPath='Prog:Internet/IBrowse/IBrowse'
/* Default browser (possible inputs: IBrowse, Voyager and AWeb) */
UsedBrowser='IBrowse'
/* Load URL in a new window (1=yes) */
NewWindow=1
/* Use running browser if available (1=yes) */
AutoBrowser=1
/* ----------------------- DON'T EDIT BELOW THIS LINE ---------------------- */
OPTIONS RESULTS
OPTIONS FAILAT 21
PARSE ARG URL
UB = UPPER(UsedBrowser)
rxports=SHOW('P')
IF AutoBrowser=1 THEN DO
IF SHOW('P','IBROWSE') THEN UB='IBROWSE'
ELSE IF SHOW('P','VOYAGER') THEN UB='VOYAGER'
ELSE IF INDEX(rxports,'AWEB')>0 THEN UB='AWEB'
END
SELECT
WHEN UB='IBROWSE' THEN port='IBROWSE'
WHEN UB='VOYAGER' THEN port='VOYAGER'
WHEN UB='AWEB' THEN DO
PARSE VAR rxports dummy 'AWEB.' portnr .
IF portnr = '' THEN portnr = 1
port='AWEB.' || portnr
END
OTHERWISE EXIT 10
END
ADDRESS COMMAND
IF ~SHOW('P',port) THEN DO
NewWindow = 0
'RUN >NIL:' browserpath
'SYS:rexxc/WaitForPort' port
IF RC>0 THEN DO
ADDRESS YAM 'REQUEST "'usedbrowser' not found.\nPlease install 'usedbrowser' or change the script configuration!" "Okay!"'
EXIT 5
END
END
IF UseMiami=1 THEN DO
IF ~SHOW('P', 'MIAMI.1') THEN DO
'Run <>NIL:' miamipath
'WaitForPort MIAMI.1'
END
ADDRESS 'MIAMI.1'
ISONLINE
IF RC=0 THEN ONLINE
ISONLINE
IF RC=0 THEN EXIT 5
HIDE
END
INTERPRET 'ADDRESS' port
SELECT
WHEN UB='IBROWSE' THEN DO
IF NewWindow=1 THEN 'NewWindow 'url
ELSE 'GotoURL 'url
END
WHEN UB='VOYAGER' THEN DO
IF NewWindow=1 THEN 'OpenURL 'url' NEWWIN'
ELSE 'OpenURL 'url
END
WHEN UB='AWEB' THEN DO
IF NewWindow=1 THEN 'New 'url
ELSE 'Open 'url
END
END
EXIT